<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>商品详情</title>
    <link href="__INDEX__/css/mui.min.css" rel="stylesheet"/>
    <link rel="stylesheet" href="__INDEX__/css/iconfont.css" />
    <link rel="stylesheet" href="__INDEX__/css/style.css" />
    <link rel="stylesheet" href="__INDEX__/css/yund.css" />
</head>
<body>

	<header class="mui-bar mui-bar-nav show_bar_nav">
		<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" href="JavaScript:history.go(-1)"></a>
		<h1 class="mui-title"><a href="#sp" class="active goodsshow1">商品</a><a href="#xq" class="goodsshow2">详情</a><a href="#pj">评价</a></h1>
	</header>
	<div class="mui-content" id="sp">
		<div class="xqy_cpimg" ><img src="{$goods_info.logo|default='__INDEX__/bg.png'}"></div>
		<div class="xqy_shopbox">
			<div class="shopbox_top clearfix">
				<div class="shopb_t_l clearfix">
					<div class="shopb_img"><img id="shop_logo" src="{$goods_info['logo']|default='__INDEX__/bg.png'}"></div>
					<div class="shopb_info">
						<p class="shopb_nam" id="shop_name">{$goods_info['agent_name']|default='无'}</p>
					</div>
				</div>
			</div>
			<div class="shopbox_btn" id="xq">
				<a href="{:url('index/shop/shop',['agent_id'=>$goods_info['agent_id']])}">进店逛逛</a>
			</div>
		</div>
		<div class="xqy_pjbox" id="pj">
			<p class="xqy_pjicon"><span class="iconfont icon-icon_order"></span>评价</p>
			<div class="xqy_pjnr">
				<p class="xqy_pjbt">宝贝评价</p>
				<ul class="xqy_pjlist">
					{volist name='comment_list' id='vo'  empty='暂无数据'}
						<li>
							<div class="xqy_pjlis_mem">
								<span class="xqy_pjlis_memtx"><img src="{$vo.member_logo|default='__INDEX__/bg.png'}"></span>
								<span class="xqy_pjlis_memnam">{$vo['nick_name']}</span>
								<span class="pjstar star0{$vo['goods_score']}"></span>
							</div>
							<div class="xqy_pjlis_time">
								<span>{$vo['add_time']}</span>
							</div>
							<div class="xqy_pjlis_info">{$vo['content']}</div>
						</li>
					{/volist}
				</ul>
			</div>
		</div>
	</div>
	<nav class="mui-bar mui-bar-tab spxq_bar_tab"  id="footer-list">
		<a class="mui-tab-item" href="{:url('index/shop/shop',['agent_id'=>$goods_info['agent_id']])}" >
			<span class="mui-icon iconfont icon-shangcheng"></span>
			<span class="mui-tab-label" >店铺</span>
		</a>
		<a class="mui-tab-item" id="go_shop2" href="{:url('shop/shopcart')}">
			<span class="mui-icon iconfont icon-gouwuche1"></span>
			<span class="mui-tab-label" >购物车</span>
		</a>
		<a class="mui-tab-item" onclick="add_collect()" {if !is_null($is_collect)}style='color: #FFAA2B;'{/if}>
			<span class="mui-icon iconfont icon-xingxing"></span>
			<span class="mui-tab-label">收藏</span>
		</a>
		<a class="mui-tab-item add_cart" id='add_cart'  onclick="add_cart()">加入购物车</a>
		<a class="mui-tab-item add_lijgm" href="{:url('member/order_buy',['goods_id'=>$goods_info['goods_id']])}">立即购买</a>
	</nav>
</body>
</html>
{include file="public/footer" /}
<script>
	function add_cart(){
		layer.confirm('您确定加入购物车吗？', {
			btn: ['确定', '取消'] //按钮
		}, function() {
			$.ajax({
				type:"post",
				url: "{:url('index/shop/add_cart')}",
				data: {goods_id :"{$goods_info['goods_id']}"},//表单数据
				success: function(data) {
					layer.msg(data.msg);
				}
			})
		})
	}
	
	function add_collect(){
		$.ajax({
				type:"post",
				url: "{:url('index/shop/add_collect')}",
				data: {goods_id :"{$goods_info['goods_id']}"},//表单数据
				success: function(data) {
					layer.msg(data.msg, {
					  icon: 1,
					  time: 1000 //2秒关闭（如果不配置，默认是3秒）
					}, function(){
						  if(data.code == 200) {
							 location.reload();
						  }
					}); 
				}
			})
	}
</script>